Skip to main content

Checkout SDK

Although for the checkout page, a wide range of settings is available through the admin panel, for example, placing your own logo, changing the colors of basic elements. But if these opportunities are not enough to ensure corporate style the Checkout SDK empowers you to fully customize your payment form while ensuring that your payment processing remains compliant with the Payment Card Industry Data Security Standard (PCI DSS).

caution

Currently, only acquiring payment forms with a CARD payment method are supported (where card data is entered on the form itself). P2P, debit payment forms are not supported, and payment methods such as ApplePay, GooglePay, etc. are not supported also.

Payment form development

When developing your own payment page or adapting an existing one, the following conditions must be met:

  1. Technology stack - HTML / CSS / JavaScript
  2. Project folder structure:
  • /img
  • /style
  • /js
  1. You need to connect Checkout SDK module in the payment page code:

    <script src="https://checkout.dineropay.com/sdk/pay-session.js"></script>
  2. It is necessary to create a new instance of the PaySession class by passing to the constructor function the identifier of the HTML element of the form for entering data on the payment page and the parameter if on-the-fly validation of the payment form fields is needed (optional parameter).
    Next, call the begin() method:

<script>
const session = new PaySession({ formName: "paymentForm", validateOnInput: true });
session.begin();
</script>
  1. In the payment page HTML code, you need to link the <input> tags of the form to Checkout SDK module using special id identifiers. The module interacts only with those <input> elements that are inside the <form> tag and are indicated by the corresponding id:

    inputTypeMandatory
    Payment card numberpayer_cardY
    CVV codepayer_cvvY
    Expiry datepayer_expiryDateY
    Payer namepayer_nameY
    ZIP codepayer_zipN
    Payer citypayer_cityN
    Payer phone numberpayer_phoneN
    Payer emailpayer_emailN
    Payer addresspayer-addressN
    Payer countrypayer_countryN
  2. The Checkout SDK module implements a number of event listeners, the result of which is available for processing on the form page. Event handling is optional.

Called when the response declined is received at the time of payment processing or when checking the session state. Returns an object with the error message: {message: string}.

Event Handler code example

session.onDecline = function (event) {
document.querySelector(".decline-message").innerText = event.message;
};

Submitting the Payment form

After developing the payment form, it is necessary to send the project archive, including the source code and all used files, to the support team for review, security testing and placement on the platform resources.

Example

An example of the payment form code can be downloaded from the link